#pragma once
#include <tuple>
#include <boost/noncopyable.hpp>
#include "TextureAtlasInfo.hpp"
#include "ImportExport.hpp"

namespace he
{
	class BuildingMaterialManager : boost::noncopyable
	{
		// Typedefs
	private:
		//! Vector of texture atlas variants;
		typedef std::vector<TextureAtlasInfo_t> TerrainAtlasVariantVector_t;
		//! Tuple of texture atlas variants <material, outdoor, indoor>
		typedef std::tuple<std::string, TerrainAtlasVariantVector_t, TerrainAtlasVariantVector_t> BuildingTextureAtlasTuple_t;
		//! Map of building types.
		typedef std::map<std::uint_least8_t, BuildingTextureAtlasTuple_t> BuildingTypeMap_t;

		// Attributes
	private:
		//! Map of building types.
		BuildingTypeMap_t m_Buildings;

		// Operations
	public:
		//! Get material name for given type.
		HE_ENGINE_API std::string material_name(std::uint_least8_t Type) const;
		//! Get building texture atlas info for given type and variant.
		/*!
			 For outdoor.
		*/
		HE_ENGINE_API TextureAtlasInfo_t variant_info_outside(std::uint_least8_t Type, std::uint_least8_t Variant) const;
		//! Get building texture atlas info for given type and variant.
		/*!
			 For inside.
		*/
		HE_ENGINE_API TextureAtlasInfo_t variant_info_inside(std::uint_least8_t Type, std::uint_least8_t Variant) const;
	private:
		//! Get material tuple.
		BuildingTextureAtlasTuple_t const &material_tuple(std::uint_least8_t Type) const;

		// Construction/Destruction
	public:
		//! Read all data from xml file.
		BuildingMaterialManager(boost::filesystem::path const &Path);
	};
} /*he*/
